<%--
  Created by IntelliJ IDEA.
  User: wxwx
  Date: 2025/4/3
  Time: 10:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page isELIgnored="false" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>图书列表</title>
</head>
<body>
<h1>图书列表</h1>
<form action="${pageContext.request.contextPath}/books" method="get">
    <label for="minPrice">最低价格:</label>
    <input type="text" id="minPrice" name="minPrice">
    <input type="submit" value="筛选">
</form>
<table border="1">
    <tr>
        <th>书名</th>
        <th>价格</th>
    </tr>
    <c:forEach var="book" items="${books}">
        <c:set var="minPrice" value="${param.minPrice}" />
        <c:if test="${empty minPrice || book.price >= minPrice}">
            <tr>
                <td>${book.title}</td>
                <td>${book.price}</td>
            </tr>
        </c:if>
    </c:forEach>
</table>
</body>
</html>